home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir35 / cusort31.zip / CUSORT.DOC next >
Text File  |  1993-06-22  |  11KB  |  245 lines

  1. |    Colorado Utilities Sort (CUSORT v.3)
  2. |
  3. |    by
  4. |
  5. |    Fred C. Hill
  6. |
  7. |    Micro System Solutions
  8. |    5048 W. Maplewood Ave.
  9. |    Littleton, CO 80123
  10. |    1-(303) 795-7653
  11. |    1-(800) 421-1789 (orders)
  12. |
  13. Sorting is one of those things every computer user must do at one time or 
  14. another, and the sort program provided with most versions of DOS just 
  15. doesn't do the job. It's slow; only sorts from column one; won't sort 
  16. descending; has a limited capacity; and only uses regular memory to sort in. 
  17. Not a very useful program when you have hundreds of thousands of records you 
  18. want sorted in position 25 for 12 characters.
  19.  
  20. CUSort implements what is known as a virtual sort, allowing you to sort more 
  21. than will fit in RAM at one time.  It does this by sorting manageable 
  22. portions of the input file first, and then merging these pre-sorted lists to 
  23. form the final output file.  In theory, two billion records can be sorted in 
  24. one run. In actual practice, the number of records will be limited only by 
  25. the amount of available disk or expanded memory (EMS) capacity, and, of 
  26. course, the amount of time you're willing to wait. 
  27.  
  28. System Statistics.
  29. During the modifications, seceral large test files were prepared and sorted 
  30. using  CUSORT.  The results show that the larger the file, the greater the 
  31. exponential increase in sorting time.  For example. When sorting a 500K
  32. file of 80 character records it took approximately 50 seconds or 10K 
  33. records per second. A 1,000K file took approx 108 seconds or 9K records 
  34. per second. A 4,000K file took 17 minutes 55 seconds (1075 seconds) or 
  35. 3.7K records per second. These figures where compiled on a 486 33mHz PC 
  36. with 16 meg of memory. Larger files will take a proportionately longer 
  37. period of time.
  38.  
  39. CuSort Revision history
  40.  
  41. version 3.1 - June 1993
  42.   o  Added an activity indicator on the screen while sorting.  This will 
  43.      ensure users know that sort is operating.
  44.   o  Added an option (#) to allow users to alter the sort buffer size to
  45.      fine tune sorting. Changing this parameter normally provides a small
  46.      1 or 2 second change in sorting times. The maximum allowed is 64 (K).
  47. version 3.0 - June 1993
  48.   o  Added an option (F) to sort fixed length records. These records 
  49.      typically have no CR/LF separator and are written by BASIC, COBOL
  50.      etc.
  51.   o  Changed the file parameter from piped in/out to regular file I/O to
  52.      support fixed length records.
  53.  
  54. version 2.3 - April 1993
  55.   o  Fixed the comparison routine to give proper results when two records
  56.      of different lengths are processed. Prior to v2.3 the compare terminated 
  57.      at the length of the longer record.  All record lengths are now padded 
  58.      to the length of the larger prior to testing equality. Thanks to
  59.      Ray Schildknecht for the bug report.
  60.   
  61.   o  Added the capability to sort individual fields in decending mode. See
  62.      use documentation for details.
  63.  
  64. version 2.2 - November 1992
  65.   o  Fixed a bug in the parameter parsing which would not set the descending 
  66.      sort option properly.
  67.      Changed the version number to x.x vs x.xx
  68.  
  69. version 2.16 - February 1992
  70.   o  Added the quiet mode operation (/Q) at the request of Dave Holley of 
  71.      MicroMax Computer Services Corp.
  72.  
  73. version 2.1 - November 1990
  74.   o  Option E added.  Do not use Expanded memory even if available.
  75.  
  76.   o  At an abnormal termination CuSort now removes its work files.
  77.  
  78.   o  Bugs fixed - 
  79.   o   Option L flag was never initialized so it could be invoked at any 
  80.       time by leftover memory contents.
  81.  
  82.   o   StdIn was not always used properly.
  83.  
  84.   o   The D (remove duplicates) & L (sort by length) options were added at 
  85.       the request of Terry Hall of Illinois.  This addition allowed me to 
  86.       find the /B option bug also.
  87.  
  88. version 2.0 - August 1990
  89.   o   Option D Directory changed to Option R Redirect.
  90.  
  91.   o   Option D Added to indicate "No duplicates to be written."
  92.  
  93.   o   Option L added to indicate "Sort by record length."
  94.  
  95.   o   Bug fixed - if blank record option (/B) not selected the program would 
  96.       not produce an output file.
  97.  
  98. CUSort's operation is determined by the command line parameters you
  99. give it when the program is started.  The command line format is
  100.  
  101.      CuSort [options] <inputFile >outputFile
  102.  
  103.      Options:
  104.  
  105.          /-   Sort all fields in descending order. The default is
  106.               ascending order. See the /S command to sort an
  107.               individual field in descending order. When sorting by 
  108.               fields (/S command) this parameter will result in the 
  109.               entire file being sequenced in descending order from 
  110.               the major sort field to the minor sort field.
  111.          
  112.          /#   Change sort buffer size. The input is in K (1024 
  113.               character blocks) and the range is 1 to 64.  This was 
  114.               added for product testing and its use is arbitrary and 
  115.               not recommended.  The system will default to 24K
  116.  
  117.          /B   Do not write blank records. All blank records
  118.               found during the input phase will be discarded.
  119.  
  120.          /C xxx Set maximum record size to xxx. This will allow CUSORT 
  121.               to allocate a fixed record size and make the sort more 
  122.               effecient. Only use this option if you know absolutly 
  123.               what the maximum record size is.
  124.  
  125.          /D   Do not write duplicate records.
  126.  
  127.          /E   Do not use Expanded Memory (EMS) even if that memory
  128.               is available.
  129.  
  130.          /F xxx Set the size of a fixed length record. Some languages 
  131.               do not write a CR/LF for some file types. In BASIC, for 
  132.               example, a file opened for Random processing does not
  133.               get CR/LF's. By using the F option you can sort these files
  134.               as you would a normal text file.
  135.  
  136.          /L   Sort by length of record. /S parm is ignored.
  137.  
  138.          /I   Ignore upper/lower case.  All input is compared
  139.               as if it were upper case.
  140.  
  141.          /Q   Run in quiet mode.  No output is made to the StdErr
  142.               file. (StdErr is normally defined to the screen)
  143.  
  144.          /R xx     Redirect temporary sort files to directory
  145.                    xx. (files will be deleted before program
  146.                    terminates.)
  147.  
  148.          /S c,l[-]    
  149.               Sort fields ... c = column; l = length. You may
  150.               have a maximum of 6 /S fields during any single
  151.               run. They must be placed in priority sort order. 
  152.               Placing a minus sign '-' anywhere in the parameter 
  153.               will cause that field to be sorted in descending 
  154.               order.
  155.  
  156.          /T   Trim records. This parameter allows you to
  157.               remove blanks at the beginning and end of the
  158.               input records. Sequencing is done prior to
  159.               trimming.
  160.  
  161. Caution:  When using the descending options, the option can only be 
  162.           set once for each field.  If you use the global [/-] option
  163.           and then set a sort field in descending or [/S c,l-] the 
  164.           sequence will still be descending. In other words, using both
  165.           options will not reverse the ordering.
  166.  
  167.      Examples:
  168.  
  169.      CuSort /B /S 1,25  textin.dat  textout.dat
  170.           This example sorts just like the DOS sort except that the
  171.           sort field size is limited to 25 characters and any blank
  172.           records found during sorting will not be included in the
  173.           output file.
  174.  
  175.      CuSort /- /I  textin.dat  textout.dat
  176.           This example sorts the entire file, including blank
  177.           records in descending sequence. Lower case and Upper case
  178.           are sorted together.
  179.  
  180.      CuSort /I /S 10,5- /S 2,6  textin.dat  textout.dat
  181.           This example sorts on column 10 for 5 characters as the
  182.           major sort field (descending order) and column 2 for 6 
  183.           characters as the minor sort field (ascending order). 
  184.           Upper and lower case characters are sorted together.
  185.  
  186.      CuSort /- /I /S 10,5 /S 2,6  textin.dat  
  187.           This example sorts on column 10 for 5 characters as the
  188.           major sort field (descending order) and column 2 for 6 
  189.           characters as the minor sort field (ascending order). The 
  190.           entire file is sorted in descending sequence and upper and 
  191.           lower case characters are sorted together. Since no output 
  192.           file name was included it will be named "TEXTIN.SRT".
  193.  
  194.      CuSort /L /D /Q <textin >textout
  195.           This example will sort records by length of record and
  196.           will remove any duplicate records. Operate in quiet mode
  197.     ORDER FORM
  198.  
  199.      Name: ------------------------------------------------------
  200.  
  201.      Address: ---------------------------------------------------
  202.  
  203.      City: ---------------------------- State: ---- Zip: --------
  204.  
  205.      Phone: (     ) -------------------------------
  206.  
  207.      Credit card:   type -  Visa     Mastercard
  208.  
  209.      Card number: ------------------------------ expires ---/---
  210.      
  211.      Name on card: ---------------------------------------------
  212.  
  213. ----------------------------------------------------------------
  214.      CuSort latest version . . . . . . . . . . . . . . . $ 24.00
  215.           Includes the following..
  216.                Current disk direct from author
  217.                Telephone support
  218.                Notification of further upgrades and
  219.                     products.
  220.  
  221.      Colorado residents include 3% state tax and 
  222.           appropriate local tax. . . . . . . . . . . . . .$ -----
  223.  
  224.                          Shipping & Handling . . . . . . .$  5.00
  225.  
  226.                          Total included  . . . . . . . . .$ -----
  227.  
  228.  
  229. ----------------------------------------------------------------
  230. Order in one of three ways... Fill out this form and mail to: 
  231.      Micro System Solutions
  232.      5417 S. Cimarron Rd.
  233.      Littleton, CO 80123
  234. - or -
  235.      Call 1-(800) 421-1789 or 1-(300) 795-7653 (credit card orders)
  236. - or-
  237.      Leave a Compuserve CMail (Compuserve Mail) message for
  238.      Micro System Solutions (Fred C. Hill PPN 76060,102) with all
  239.      of the information above. (credit card orders or information
  240.      only please, DO NOT leave messages with credit card numbers
  241.      in the forum areas)
  242. ----------------------------------------------------------------
  243.  
  244.      
  245.